package com.edison.demoservice2.controller;


import com.edison.demoservice2.service.DemoService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@AllArgsConstructor
@RestController
@Slf4j
@RequestMapping("/service-2")
public class DemoService2Controller {

    @Autowired
    private DemoService demoService;

    @RequestMapping("/test/{type}")
    public String test(@PathVariable("type") String type)
    {
        log.info("service-2 接收到了请求，type: {}",type);
        return demoService.test(type);
    }


}
